package com.base.service;

import com.base.po.collect.CollectCommodities;

import java.util.List;

/**
 * 收藏商品接口
 */
public interface CollectCommodityService {

    /**
     * 收藏该商品
     * @param collectCommodities
     * @return
     */
    int insertCollectCommodity(CollectCommodities collectCommodities);

    /**
     *  查询用户的浏览记录
     * @param uId  用户ID
     * @param pId 代理商ID
     * @param start  起始页
     * @param num   查询条数
     * @return
     */
    List<CollectCommodities> findCollectCommodityByUidAndPid(String uId, String pId, Integer start, Integer num);

    /**
     * 删除收藏记录
     * @param ccId
     * @return
     */
    boolean deleteCollectCommodity(String ccId);

    /**
     * 更新商品收藏日期
     * @param collectCommodities
     * @return
     */
    boolean updateCollectCommodityDate(CollectCommodities collectCommodities);

    /**
     * 查询用户是否收藏了本商品
     * @param uId
     * @param comId
     * @param parentId
     * @return
     */
    boolean hasCommodityBy(String uId,String comId,String parentId);

    /**
     * 取消收藏
     * @param collectCommodities
     * @return
     */
    boolean cancelCollect(CollectCommodities collectCommodities);
}
